package io.github.uicdb.et;

import io.github.uicdb.et.block.ElementMachineBlockEntity;
import io.github.uicdb.et.block.ExtractMachineBlockEntity;
import io.github.uicdb.et.block.TurnInBlockEntity;
import io.github.uicdb.et.block.multipart.impl.ForgeAltarBE;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public class ModBlockEntityType {
    private static final DeferredRegister<BlockEntityType<?>> register = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, ElementalTheory.MODID);
    public static final DeferredHolder<BlockEntityType<?>, BlockEntityType<ForgeAltarBE>> FORGE_ALTAR = register.register("forge_altar", () ->
            BlockEntityType.Builder.of(ForgeAltarBE::new, ModBlocks.FORGE_ALTAR.get()).build(null)
    );
    public static final DeferredHolder<BlockEntityType<?>, BlockEntityType<ExtractMachineBlockEntity>> EXTRACT_MACHINE = register.register("extract_machine", () ->
            BlockEntityType.Builder.of(ExtractMachineBlockEntity::new, ModBlocks.EXTRACT_MACHINE.get()).build(null)
    );
    public static final DeferredHolder<BlockEntityType<?>, BlockEntityType<ElementMachineBlockEntity>> ELEMENT_MACHINE = register.register("element_machine", () ->
            BlockEntityType.Builder.of(ElementMachineBlockEntity::new, ModBlocks.ELEMENT_MACHINE.get()).build(null)
    );
    public static final DeferredHolder<BlockEntityType<?>, BlockEntityType<TurnInBlockEntity>> TURN_IN_MACHINE = register.register("turn_in_machine", () ->
            BlockEntityType.Builder.of(TurnInBlockEntity::new, ModBlocks.TURN_IN_MACHINE.get()).build(null)
    );
    public static void init(IEventBus modEventBus) {
        register.register(modEventBus);
    }
}
